package ca.qc.bdeb.info.pp2.tp2.controleur;

import ca.qc.bdeb.info.pp2.tp2.application.AgentBean;
import ca.qc.bdeb.info.pp2.tp2.application.Facade;
import java.util.ArrayList;
import java.util.List;
import javax.servlet.http.HttpServletRequest;

public class CommandeAfficherAgents implements Commande
{
    private String next;

    public CommandeAfficherAgents(String next)
    {
        this.next = next.toLowerCase();
    }

    @Override
    public String executer(HttpServletRequest req) throws CommandeException
    {
        Facade f = new Facade();
        List<AgentBean> abean = new ArrayList<AgentBean>();
        abean = f.getAgent();
        req.setAttribute(ConstantesWeb.VALEURS_LISTE_AGENTS, abean);

        return next;
    }
}
